![]() |
PATH![]() |
![]() ![]() |
By default, Navigation Services draws a preview in the Open dialog box when a file selected in the browser list contains a valid
'pnot'
component. To override how previews are drawn and handled, you can create a
preview-drawing function, as described in MyPreviewProc
. You register your preview-drawing function by passing a Universal Procedure Pointer (UPP) in the
previewProc
parameter of a Navigation Services function such as NavGetFile
. You obtain this UPP by calling the macro
NewNavPreviewProc
and passing a pointer to your preview-drawing function. When the user selects a file, Navigation Services calls your preview-drawing function. Before you attempt to create a custom preview, your application should determine whether previews are enabled by specifying the
kNavCtlIsPreviewShowing
constant in the NavCustomControlMessages parameter of the function NavCustomControl
.
Your preview-drawing function obtains information from a structure of type NavCBRec
specified in the
callBackParms
parameter of your event-handling function. The
NavCBRec
structure contains the following information:
NavEventData
describing the file to be previewed. This structure provides an Apple event descriptor list (
AEDescList
) that you must be able to coerce into a file specification (
FSSpec)
. If you cannot coerce the
AEDescList
into a valid
FSSpec
, then the object is not a file and you should not attempt to create a preview.Once you have determined that previews are enabled, your preview-drawing function should draw the custom preview in the specified area and return a function result of true . If you don't want to draw a preview for a given file, be sure to return a function result of false .
Previous | Back Up One Level | Next |